//
// HostApi.hpp for HostApi in /home/mambou_j//babel-2014
// 
// Made by jacquesquentin mamboumouafo
// Login   <mambou_j@epitech.net>
// 
// Started on  Mon May 14 16:50:46 2012 jacquesquentin mamboumouafo
// Last update Tue May 15 15:59:50 2012 jacquesquentin mamboumouafo
//


#ifndef	__HOSTAPI_HPP__
#define	__HOSTAPI_HPP__

#include	"portaudio.h"
#include	"System.hpp"

//Forward declaration(s):
namespace	portaudio
{
  class	Device;
}

// Declaration(s):
namespace	portaudio
{
	class	HostApi
	{
	public:
	  typedef	System::DeviceIterator DeviceIterator;

	  // query info: id, name, numDevices
	  PaHostApiTypeId	typeId() const;
	  PaHostApiIndex	index() const;
	  const	char	*name() const;
	  int	deviceCount() const;

	  // iterate devices
	  DeviceIterator	devicesBegin();
	  DeviceIterator	devicesEnd();

	  // default devices
	  Device	&defaultInputDevice() const;
	  Device	&defaultOutputDevice() const;

	  // comparison operators
	  bool	operator==(const HostApi &rhs) const;
	  bool	operator!=(const HostApi &rhs) const;

	private:
	  const	PaHostApiInfo	*info_;
	  Device	**devices_;

	private:
	  friend	class	System;
	  explicit	HostApi(PaHostApiIndex	index);
	  ~HostApi();

	  HostApi(const HostApi &);
	  HostApi	&operator=(const HostApi &);
	};
}

#endif
